107

Create Your Own Interface Diagram

107

STEP 3 & 4

Sheets(“Diagram”).Select

While MaxCount > 0

‘For i =​ 1 To NumberOfRows

    ‘ poll the entities sheet to see which one has max count of connections. start there,

and then go to the next, etc

    i =​ RowToGraph

    If (Previousarow <> arow Or PreviousToggleSwitch <> ToggleSwitch) And

MaxCount > 5 Then

      ‘RowsCompletedForCurrentMax =​ 0

      If ToggleSwitch =​ -​1 Then

        HighestMaxCount =​ Worksheets(“Entities”).Cells(arow, 2).Value

      Else

        HighestMaxCount =​ Worksheets(“Entities”).Cells(arow, 3).Value

      End If

      If NextLeftShape > 1 Then

        If ColumnOffset <> 36 Then

        If MaxNextLeftShape > NextLeftShape Then

          MaxNextLeftShape =​ NextLeftShape

        End If

        NextLeftShape =​ 1

        If MaxNextRightSHape > NextRightShape Then

          MaxNextRightSHape =​ NextRightShape

        End If

        NextRightShape =​ 1

        ColumnOffset =​ ColumnOffset +​ 12

      Else

      ‘ this part of the code is disabled now since columnoffset will never be

equal to 36.

      ‘ But can be changed to fit in a less wide and more tall format

      ColumnOffset =​ 0

      If MaxNextLeftShape > NextLeftShape Then

        MaxNextLeftShape =​ NextLeftShape

      End If

      NextLeftShape =​ 1

      If MaxNextRightSHape > NextRightShape Then

        MaxNextRightSHape =​ NextRightShape

    End If

    NextRightShape =​ 1

    RowOffset =​ RowOffset +​ 7 * MaxNextRightSHape

    End If

End If

End If

    k =​ 6 * NextLeftShape +​ 2 +​ RowOffset

    l =​ 1 +​ ColumnOffset

    m =​ k +​ 2

    n =​ 4 +​ ColumnOffset

    OldShapeBegin =​ True

    Label =​ CurrentSheet.Cells(i, 1)

    If Label <> ““ Then

      If Not ShapeExists(Label) Then